package bit.mybatisdemo.demos.mapper;

import bit.mybatisdemo.demos.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

//这里的代码用于练习mybatis进阶
@Mapper
public interface UserInfo2MapperXML {

    List<UserInfo>getUserInfoList();

//    @Insert("<script>"+
//            " insert into user_info ("+
//            "username, `password`,age,"+
//            " <if test=\"gender!=null\"> gender</if> )"+
//            "values ("+
//            " #{username},"+
//            "  #{password},"+
//            " #{age},"+
//            " <if test=\"gender!=null\">"+
//            " #{gender}"+
//            " </if>"+
//            ");"+
//            "</script>"
//    )
    Integer InsertUserByCondition(UserInfo userInfo);

    List<UserInfo> queryByCondition(UserInfo userInfo);

    Integer updateUserByCondition(UserInfo userInfo);

    void deleteUserByCondition(List<Integer> ids);
}
